﻿// ParseLib - An open source library for natural language processing.
// Copyright (C) Kais Dukes, 2012. E-mail: kais@kaisdukes.com
// http://parselib.org

using log4net;
using log4net.Appender;
using log4net.Layout;
using log4net.Repository.Hierarchy;

namespace ParseLib.Tests
{
    public static class TestUtil
    {
        public static void EnableLogging()
        {
            var layout = new PatternLayout
                             {
                                 ConversionPattern = "%utcdate [%level] %message%newline"
                             };
            layout.ActivateOptions(); 
            
            var hierarchy = (Hierarchy)LogManager.GetRepository();
            hierarchy.Root.AddAppender(new ConsoleAppender { Layout = layout });
            hierarchy.Configured = true;
        }
    }
}
